/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author antonio
 */
@Embeddable
public class ManufacturePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "resource")
    private int resource;
    @Basic(optional = false)
    @NotNull
    @Column(name = "factory")
    private int factory;

    public ManufacturePK() {
    }

    public ManufacturePK(int resource, int factory) {
        this.resource = resource;
        this.factory = factory;
    }

    public int getResource() {
        return resource;
    }

    public void setResource(int resource) {
        this.resource = resource;
    }

    public int getFactory() {
        return factory;
    }

    public void setFactory(int factory) {
        this.factory = factory;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) resource;
        hash += (int) factory;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ManufacturePK)) {
            return false;
        }
        ManufacturePK other = (ManufacturePK) object;
        if (this.resource != other.resource) {
            return false;
        }
        if (this.factory != other.factory) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.ManufacturePK[ resource=" + resource + ", factory=" + factory + " ]";
    }
    
}
